Don't add class "scrollbar" for every trough
authorMatthias Clasen <mclasen@redhat.com>
Fri, 26 Nov 2010 02:47:46 +0000 (21:47 -0500)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:39:47 +0000 (15:39 +0100)
Turns out "trough" as a detail string is used in a variety
of widgets, not all of which are scrollbars.

gtk/gtkscrollbar.c
gtk/gtkstyle.c

index d04ed7c387bc6cbb83e4e710c71bf74f37772ed7..df4ad75b9c57dab277ff7c67e395d487cff29b21 100644 (file)
@@ -118,6 +118,10 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class)
 static void
 gtk_scrollbar_init (GtkScrollbar *scrollbar)
 {
+  GtkStyleContext *context;
+
+  context = gtk_widget_get_style_context (GTK_WIDGET (scrollbar));
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_SCROLLBAR);
 }
 
 static void
index a59f1e4bb468d94cbe3ba17e6afce5252b0a1686..9fea0d342040fdbd31842ed6dae75487b2408638 100644 (file)
@@ -1805,10 +1805,7 @@ transform_detail_string (const gchar     *detail,
           strcmp (detail, "viewportbin") == 0)
     gtk_style_context_add_class (context, "viewport");
   else if (strncmp (detail, "trough", 6) == 0)
-    {
-      gtk_style_context_add_class (context, "scrollbar");
-      gtk_style_context_add_class (context, "trough");
-    }
+    gtk_style_context_add_class (context, "trough");
   else if (strcmp (detail, "spinbutton") == 0)
     gtk_style_context_add_class (context, "spinbutton");
   else if (strcmp (detail, "spinbutton_up") == 0)